This is an example of a reusable canvas-based class that draws a grid. The user can click on cells in the grid to select them. You can also control the colors used, determine which cell has been clicked (via the CellClicked event) and decide whether or not to accept or reject a click.